//
//  MyCollectionReusableView.m
//  FNer
//
//  Created by dllo on 15/11/5.
//  Copyright © 2015年 刘志强. All rights reserved.
//

#import "MyCollectionReusableView.h"
#import "Themes.h"
@implementation MyCollectionReusableView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self greateReusableV];
    }
    return self;
}

-(void)greateReusableV
{
    self.tuijianView = [[UIView alloc] initWithFrame:CGRectMake(10 * XWIDTH, 10 * XHIGHT, 355 * XWIDTH, 29 * XHIGHT)];
    self.tuijianLabel = [[UILabel alloc] initWithFrame:CGRectMake(27 * XWIDTH, 4 * XHIGHT, 100 * XWIDTH, 21 * XHIGHT)];
    self.tuijianImageView = [[UIImageView alloc] initWithFrame:CGRectMake(9 * XWIDTH, 9 * XHIGHT, 11 * XWIDTH, 11 * XHIGHT)];
    self.smallTilteView = [[UIView alloc] initWithFrame:CGRectMake(10 * XWIDTH, 10 * XHIGHT, 355 * XWIDTH, 29 * XHIGHT)];
    self.atuijianImageView = [[UIImageView alloc] initWithFrame:CGRectMake(9 * XWIDTH, 9 * XHIGHT, 11 * XWIDTH, 11 * XHIGHT)];
    self.atuijianLabel = [[UILabel alloc] initWithFrame:CGRectMake(27 * XWIDTH, 4 * XHIGHT, 100 * XWIDTH, 21 * XHIGHT)];
    self.moreView = [[UIView alloc] initWithFrame:CGRectMake(295 * XWIDTH, 4 * XHIGHT, 50 * XWIDTH, 21 * XHIGHT)];
    self.moreLabel = [[UILabel alloc] initWithFrame:CGRectMake(5 * XWIDTH, 0, 35 * XWIDTH, 21 * XHIGHT)];
    self.moreImageView = [[UIImageView alloc] initWithFrame:CGRectMake(35 * XWIDTH, 3 * XHIGHT, 15 * XWIDTH, 15 * XHIGHT)];
    self.moreTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(moreTapAction:)];
    self.smallTilteView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.smallTilteView];
    self.atuijianImageView.image = [UIImage imageNamed:@"蓝色点_@2x.png"];
    [self.smallTilteView addSubview:self.atuijianImageView];
    [self.smallTilteView addSubview:self.atuijianLabel];
    self.atuijianLabel.textColor = [UIColor grayColor];
    self.atuijianLabel.font = [UIFont systemFontOfSize:14 * XHIGHT];
    [self.smallTilteView addSubview:self.moreView];
    self.moreLabel.text = @"更多";
    self.moreLabel.textColor = [UIColor colorWithRed:43 / 255.0 green:130 /255.0 blue:199 / 255.0 alpha:1];
    self.moreLabel.textAlignment = 1;
    self.moreLabel.font = [UIFont systemFontOfSize:14 * XHIGHT];
    [self.moreView addSubview:self.moreLabel];
    self.moreImageView.image = [UIImage imageNamed:@"更多箭头_@2x.png"];
    [self.moreView addSubview:self.moreImageView];
    [self.moreView addGestureRecognizer:self.moreTap];
}

-(void)setAtheme:(Themes *)atheme
{
    _atheme = atheme;
    self.atuijianLabel.text = self.atheme.themeName;
}

-(void)moreTapAction:(UITapGestureRecognizer *)tap
{
    [self.myAgent pushMoreVC:self.setion];
    NSLog(@"chanelID: %ld",self.setion);
    
}

@end
